package ab.mes.service.impl;

import ab.mes.entity.BinStock;
import ab.mes.entity.FinishedProductBinStock;
import ab.mes.mapper.BinStockMapper;
import ab.mes.mapper.FinishedProductBinStockMapper;
import ab.mes.tools.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BinStockServiceImpl {
    @Autowired
    private BinStockMapper binStockMapper;

    //获取库位信息
    public Result getBinStock(){
        Result result = new Result();
        result.getMap().put("bin_stock",binStockMapper.getBinStock());
        return result;
    }

    //根据库位编号查询物料库位信息
    public Result getBinStockById(String Id){
        Result result = new Result();
        result.getMap().put("bin_stock", binStockMapper.getBinStockById(Id));
        return result;
    }


    //新增库位
    public Result insertBinStock(BinStock binStock){
        Result result = new Result();
        result.getMap().put("bin_stock",binStockMapper.editBinStock(binStock));
        return result;
    }

    //编辑库位
    public Result editBinStock(BinStock binStock){
        Result result = new Result();
        result.getMap().put("bin_stock",binStockMapper.insertBinStock(binStock));
        return result;
    }
}
